﻿using AutoMapper;
using NetTaste;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using VM.Common.Result;
using VM.Entity.EntityMap.Member;
using VM.Entity.EntityMap.Menu;
using VM.Entity.EntityMap.System.Code;
using VM.Entity.EntityMap.Topic;
using VM.IDAL.Common;

namespace VM.DAL.Common
{
    public class CommonDAL : BaseDAL, ICommonDAL
    {

        protected ISqlSugarClient _Client { get; set; }
        protected IMapper _IMapper { get; set; }

        public CommonDAL(ISqlSugarClient client, IMapper iMapper) : base(client)
        {
            _Client = client;
            _IMapper = iMapper;
        }
        public int MaskDelete(int id, int userId, int billStatus, string sqlTableName)
        {
            var dt = new Dictionary<string, object>();
            dt.Add("id", id);
            dt.Add("billStatus", billStatus);
            dt.Add("updateDate", DateTime.Now);
            dt.Add("updateUserId", userId);
            int UpdateRes = _Client.Updateable(dt).AS(sqlTableName).WhereColumns("id").ExecuteCommand();
            return UpdateRes;

        }



    }
}
